Purpose |
Add a TreeView control to a dialog. A TreeView displays a set of string data items with a parent-child relationship between the items. This creates a hierarchical list of data which can have any number of levels. The user may view the items, selecting them for use in the program at a later time. |
||||||||||||||||||||||||||||||||||||
Syntax |
CONTROL ADD TREEVIEW, hDlg, id&, txt$, x, y, xx, yy [, [style&] [, [exstyle&]]] [[,] CALL callback] |
||||||||||||||||||||||||||||||||||||
hDlg |
Handle of the dialog in which the TreeView will be created. The dialog will become the parent of the control. |
||||||||||||||||||||||||||||||||||||
Unique identifier for the control in the range 1 to 65535, frequently specified with numeric equates for clarity of the code. For example, the equate %PickList is more informative than a literal value such as 497. Best practice suggests identifiers should start at 100 to avoid conflict with any of the standard predefined identifiers. |
|||||||||||||||||||||||||||||||||||||
txt$ |
Text to associate with the TreeView control. A TreeView control does not display this text, so it is common to set this value to a null, empty string literal (""). |
||||||||||||||||||||||||||||||||||||
x,y |
Integer expressions, variables, or numeric literal values specifying the location of the control inside the dialog client area. x is the horizontal position, and y is the vertical position. 0,0 refers to the upper left corner of the dialog box client area. Coordinates are specified in the same terms (pixels or dialog units) as the parent dialog. |
||||||||||||||||||||||||||||||||||||
Integral expressions, variable, or numeric literal values, specifying the width and height of the control. xx is the width and yy is the height, given in the same terms (pixels or dialog units) as the parent dialog. |
|||||||||||||||||||||||||||||||||||||
Primary style of the TreeView control. The default TreeView style comprises %WS_TABSTOP, %TVS_HASBUTTONS, %TVS_LINESATROOT, %TVS_HASLINES, and %TVS_SHOWSELALWAYS. This default TreeView style is used if the style parameters are omitted from the statement, as in the following example: CONTROL ADD TREEVIEW, hDlg, id&, "", 100, 100, 150, 200, , , CALL TVCallback() If you include explicit style values, they replace the default values. That is, they are not added to the default styles values - your code must specify all necessary primary and extended style parameters. The primary TreeView style value can be a combination of the values below, combined together with the OR operator to form a bitmask:
|
|||||||||||||||||||||||||||||||||||||
exstyle& |
Extended style of the TreeView control. The default extended style is %WS_EX_LEFT. The default extended style is used if both the primary and extended parameters are omitted from the CONTROL ADD TREEVIEW statement, in the same manner as style& above. The extended TreeView style value can be a combination of any values below, combined together with the OR operator to form a bitmask:
|
||||||||||||||||||||||||||||||||||||
callback |
Optional name of a Callback Function that receives all %WM_COMMAND and %WM_NOTIFY messages for the control. See the #MESSAGES metastatement to choose which messages will be received. If a callback for the control is not designated, you must create a dialog Callback Function to process messages from your control. If the Callback Function processes a message, it should return TRUE (non-zero) to prevent the message being passed unnecessarily to the dialog callback (if one exists). The dialog callback should also return TRUE if the notification message is processed by that Callback Function. Otherwise, the DDT engine processes unhandled messages. |
||||||||||||||||||||||||||||||||||||
Remarks |
When a Callback Function receives a %WM_COMMAND message, it should explicitly test the value of CB.CTL and CB.CTLMSG to guarantee it is responding appropriately to the messages. |
||||||||||||||||||||||||||||||||||||
See also |
Dynamic Dialog Tools, CONTROL SET COLOR, CONTROL SET FONT, TREEVIEW |